package cycle;

/**
 * 测试 while循环
 * while(条件){
 *     代码体
 * }
 */
public class WhileDemo {


    public static void main(String[] args) {

        int a=0;

        while (a<3){
            System.out.println("I Love U ---------"+a);
            a++;
        }



        //  练习1： 计算1-100的和
        int b=1;
        int result=0;
        while(b<101){
            result+=b;
            System.out.println("b = " + b);
            b++;
        }

        System.out.println("result = " + result);





















    }

}
